package com.sitanyun.merchant.guide.frament.view.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.sitanyun.merchant.guide.R;
import com.sitanyun.merchant.guide.base.BaseActivity;
import com.sitanyun.merchant.guide.view.activity.ForgetPasswordActivity;
import com.sitanyun.merchant.guide.weiht.SharedPreferenceUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 设置密码
 */
public class UpdatePaswordActivity extends BaseActivity {


    @BindView(R.id.ll_password)
    LinearLayout llPassword;
    @BindView(R.id.img_header)
    CircleImageView imgHeader;
    @BindView(R.id.user_phone)
    TextView userPhone;
    @BindView(R.id.user_pasword)
    TextView userPasword;
    @BindView(R.id.name)
    TextView name;

    @Override
    public int getLayoutId() {
        return R.layout.activity_update_pasword;
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        setFindViewById(true);
        setTitleStr("修改密码");
    }

    @Override
    public void initView() {
        Glide.with(UpdatePaswordActivity.this).load(getIntent().getStringExtra("headerurl"))
                .error(R.mipmap.cimg).into(imgHeader);
        userPhone.setText(getIntent().getStringExtra("phone"));
        userPasword.setText(SharedPreferenceUtil.getStringData("pswd"));
        name.setText(getIntent().getStringExtra("name"));
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    /**
     *
     */
    @OnClick({R.id.ll_password,R.id.user_pasword})
    public void onViewClicked() {
        startActivity(new Intent(UpdatePaswordActivity.this, ForgetPasswordActivity.class));
    }

}
